﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Package.aspx.cs" Inherits="Package" %>

<%@ Register Assembly="Infragistics4.WebUI.WebResizingExtender.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI" TagPrefix="igui" %>
<%@ Register Assembly="Infragistics4.Web.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<%@ Register Assembly="Infragistics4.Web.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.Web.UI.ListControls" TagPrefix="ig" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <link href="~/Styles/DivTable.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        //Event when a row of ChuDauTu selected
        function onRowSelectionChanged(wdg, evntArgs) {
            //Get value from row selected
            var selectedID = evntArgs.getSelectedRows().getItem(0).get_cell(0).get_text();
            var selectedName = evntArgs.getSelectedRows().getItem(0).get_cell(1).get_text();
            var selectedMucDauTu = evntArgs.getSelectedRows().getItem(0).get_cell(2).get_text();
            var selectedDVTT = evntArgs.getSelectedRows().getItem(0).get_cell(3).get_text();
            var selectedHinhThucDT = evntArgs.getSelectedRows().getItem(0).get_cell(4).get_text();
            var selectedDateTK = evntArgs.getSelectedRows().getItem(0).get_cell(5).get_text();
             

            document.getElementById("txtMaGoiThau").value = selectedID;
            document.getElementById("txtTenGoiThau").value = selectedName;
            document.getElementById("txtMucDauTu").value = selectedMucDauTu;

            var wdd = $find("<%=wddTienTe.ClientID%>");
            wdd.set_currentValue(selectedDVTT, true);

            document.getElementById("txtHinhThucDT").value = selectedHinhThucDT;
            document.getElementById("txtDateTrienKhai").value = selectedDateTK;

            // Set selected value for ChuDauTu of parent page
            opener.document.getElementById("txtMaGoiThau").value = selectedID;
            opener.document.getElementById("txtGoiThau").value = selectedName;
            opener.document.getElementById("txtMucDauTu").value = selectedMucDauTu;
            opener.document.getElementById("lblTienTe").innerText = selectedDVTT;
            opener.document.getElementById("txtHinhThucDT").value = selectedHinhThucDT;
            opener.document.getElementById("txtThoiGianTrienKhai").value = selectedDateTK;
        }

        function PopupPicker(ctl) {
            var PopupWindow = null;
            PopupWindow = window.open('DatePicker.aspx?ctl=' + ctl, '', 'width=250,height=250');
            PopupWindow.focus();
        }
    </script>
    <style type="text/css">
        .style1
        {
            float: left; /*fix for  buggy browsers*/;
            display: table-column;
            width: 100px;
            align: right;
        }
        .style3
        {
            width: 164px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <center>
        <table class="Main" style="width: 100%;">
            <tr>
                <td colspan="5" align="center">
                    <h1>
                        ĐĂNG KÝ GÓI THẦU</h1>
                </td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td align="right" class="CellTitle">
                    Mã gói thầu:
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtMaGoiThau" runat="server" TabIndex="1" Enabled="False" Width="70px"></asp:TextBox>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td align="right" class="CellTitle">
                    Tên gói thầu:
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtTenGoiThau" runat="server" TabIndex="2" Width="270px"></asp:TextBox>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td align="right" class="CellTitle">
                    Tổng mức đầu tư:
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtMucDauTu" runat="server" TabIndex="3" Width="270px"></asp:TextBox>
                </td>
                <td>
                    <ig:WebDropDown ID="wddTienTe" runat="server" TabIndex="1" Width="60px" OnDataBound="wddTienTe_DataBound">
                        <Items>
                            <ig:DropDownItem Selected="False" Text="VNĐ" Value="VNĐ">
                            </ig:DropDownItem>
                            <ig:DropDownItem Selected="False" Text="USD" Value="USD">
                            </ig:DropDownItem>
                            <ig:DropDownItem Selected="False" Text="EURO" Value="EURO">
                            </ig:DropDownItem>
                        </Items>
                    </ig:WebDropDown>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td align="right" class="CellTitle">
                    Hình thức đấu thầu:
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtHinhThucDT" runat="server" TabIndex="4" Width="270px"></asp:TextBox>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td align="right" class="CellTitle">
                    Thời gian triển khai:
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtDateTrienKhai" runat="server" TabIndex="5" Width="270px"></asp:TextBox>
                </td>
                <td>
                    [dd/mm/yy]
                    <img src="images/calendar.jpg" style="cursor: hand;" onclick="PopupPicker('txtDateTrienKhai')"
                        height="15px;" width="15px" /></td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td colspan="4" align="center">
                    <ig:WebDataGrid ID="wdg" runat="server" AutoGenerateColumns="False" DataKeyFields="package_id"
                        Height="199px" Width="945px">
                        <Columns>
                            <ig:BoundDataField DataFieldName="package_id" Key="package_id" Header-Text="ID" Width="20px">
                                <Header Text="STT"></Header>
                            </ig:BoundDataField>
                            <ig:BoundDataField DataFieldName="package_name" Key="package_name" Header-Text="Name">
                                <Header Text="Tên gói thầu"></Header>
                            </ig:BoundDataField>
                            <ig:BoundDataField DataFieldName="total_investment" Key="total_investment" Header-Text="total_investment">
                                <Header Text="Tổng mức đầu tư"></Header>
                            </ig:BoundDataField>
                                                        <ig:BoundDataField DataFieldName="dvTienTe" Key="dvTienTe" Header-Text="dvTienTe">
                                <Header Text="Đơn vị tiền tệ"></Header>
                            </ig:BoundDataField>
                            <ig:BoundDataField DataFieldName="bidding_form" Key="bidding_form" Header-Text="total_investment">
                                <Header Text="Hình thức đấu thầu"></Header>
                            </ig:BoundDataField>
                            <ig:BoundDataField DataFieldName="deployment_time" Key="deployment_time" Header-Text="total_investment">
                                <Header Text="Thời gian triển khai"></Header>
                            </ig:BoundDataField>
                        </Columns>
                        <Behaviors>
                            <ig:Activation>
                            </ig:Activation>
                            <ig:Selection CellClickAction="Row" RowSelectType="Single">
                                <AutoPostBackFlags RowSelectionChanged="true" />
                                <SelectionClientEvents RowSelectionChanged="onRowSelectionChanged" />
                            </ig:Selection>
                            <ig:ColumnResizing>
                                <ColumnSettings>
                                    <ig:ColumnResizeSetting ColumnKey="package_id" MaximumWidth="200" MinimumWidth="50" />
                                </ColumnSettings>
                            </ig:ColumnResizing>
                            <ig:EditingCore>
                                <Behaviors>
                                    <ig:CellEditing>
                                    </ig:CellEditing>
                                </Behaviors>
                            </ig:EditingCore>
                        </Behaviors>
                    </ig:WebDataGrid>
                </td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td colspan="4">
                    <asp:Button ID="btnAdd" runat="server" Text="Thêm" TabIndex="3" OnClick="btnAdd_Click">
                    </asp:Button>
                    <asp:Button ID="btnEdit" runat="server" Text="Sửa" TabIndex="3" OnClick="btnEdit_Click">
                    </asp:Button>
                    <asp:Button ID="btnSelect" runat="server" Text="Chọn" TabIndex="3" OnClick="btnSelect_Click">
                    </asp:Button>
                </td>
            </tr>
            <tr>
                <td class="style3">
                </td>
                <td class="Hide" colspan="4">
                    <asp:Label ID="lblResult" runat="server" Visible="False" ForeColor="Red" />
                </td>
            </tr>
        </table>
    </center>
    </form>
</body>
</html>